package de.slothsoft.wasbinich.swingclient.control;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;

import javax.swing.JPanel;

import de.slothsoft.wasbinich.core.GameResult;
import de.slothsoft.wasbinich.swingclient.control.TitlePanel.ScreenSwitcher;

public class GameResultPanel extends ChildPanel {

    private static final long serialVersionUID = -7330481282343012229L;

    private GameResultControl gameResultControl;

    public GameResultPanel(ScreenSwitcher screenSwitcher) {
	super(screenSwitcher);
    }

    @Override
    protected Component createControls() {
	JPanel panel = new JPanel();
	panel.setOpaque(true);
	panel.setBackground(new Color(255, 255, 255, 127));
	panel.setLayout(new BorderLayout());

	this.gameResultControl = new GameResultControl();
	panel.add(this.gameResultControl, BorderLayout.NORTH);

	return panel;
    }

    public void showResult(GameResult gameResult) {
	this.gameResultControl.setGameResult(gameResult);
    }
}
